<template>
	<view>
		<u-navbar :title="$t('提现记录')" :border-bottom="false"></u-navbar>
		
		<view class="orderList">
			<view class="list" v-for="(item,idx) in list" :key="idx">
				<view class="tit n-flex-row n-justify-between">
					<view class="num">{{$t('提现时间')}}：{{item.create_time}}</view>
					<view class="state">{{item.status_text}}</view>
				</view>
				<view class="goods">
					<view class="info">
						<view class="gtit">
							{{$t('收款人')}}：{{item.bank_fullname}} - {{$t('收款方式')}}：{{item.bank_type}}
						</view>
						<view class="peice n-flex-row n-justify-between">
							<view class="p">{{$t('提现金额')}}：{{$t('¥')}}{{item.number}}</view>
							<view class="num">{{$t('手续费')}}：{{item.fee}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<u-empty :text="$t('暂无订单')" :show="show" mode="order" margin-top="400"></u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				show:false,
				page:1,
			}
		},
		// 触底
		onReachBottom() {
			if (this.list.length < this.page * 10) {
				return
			}
			this.page++;
			this.getData()
		},
		onLoad() {
			if (uni.getStorageSync("user")) {
				this.getData()
			}
		},
		onShow() {
			if (!uni.getStorageSync("user")) {
				uni.redirectTo({
					url:'/pages/my/login'
				})
			}
		},
		methods: {
			getData(){
				uni.showLoading({
					title: this.$t("加载中")
				})
				this.$http({
					url: "api/member/withdrawal_log",
					data:{
						status:this.current,
						page:this.page
					}
				}).then(res => {
					uni.hideLoading()
					console.log(res);
					if (res.data.code == 1) {
						if(res.data.data.length == 0){
							this.show = true
						}else{
							this.show = false
						}
						this.list = this.list.concat(res.data.data);
					}else{
						this.$tip.tip(res.data.msg)
						this.show = true
					}
				}).catch(err => {});
			},
		}
	}
</script>

<style>
@import url("../../../static/css/order.css");
</style>
